package com.sw.bbs.board.service;

import com.github.pagehelper.PageInfo;
import com.sw.bbs.board.pojo.Board;
import com.sw.bbs.board.vo.request.board.InsertBoardRequest;
import com.sw.bbs.board.vo.request.board.QueryBoardRequest;
import com.sw.bbs.board.vo.request.board.UpdateBoardRequest;
import com.sw.bbs.board.vo.response.board.BoardDetailResponse;
import com.sw.bbs.board.vo.response.board.BoardTreeResponse;
import com.sw.bbs.common.common.ServiceException;

import javax.servlet.http.HttpServletRequest;
import java.util.List;


/**
 * @Desc: No Desc
 * @Author: wusonghe
 * @Date: 2019/3/4 16:06
 */
public interface BoardService {


    /** 查询列表
     *
     * @param request
     * @return
     */
    PageInfo<Board> queryboardList(QueryBoardRequest request);

    /**
     * 查询板块详情
     * @param boardId
     * @return
     */
    BoardDetailResponse queryboardDetail(Integer boardId);


    /**
     * 新增板块
     * @param insertboardRequest
     * @return
     */
    Integer insertboardByRequest(InsertBoardRequest insertboardRequest,
                                 HttpServletRequest httpServletRequest) throws ServiceException;


    /**
     * 更新
     * @param updateboardRequest
     * @param httpServletRequest
     * @return
     * @throws Exception
     */
    Integer updateboardByRequest(UpdateBoardRequest updateboardRequest,
                                 HttpServletRequest httpServletRequest) throws ServiceException;


    /**
     * 删除
     * @param boardId
     * @return
     * @throws Exception
     */
    Integer deleteboardByRequest(Integer boardId) throws ServiceException;

    /**
     *  板块树状结构
     */
    List<BoardTreeResponse> queryboardTree() throws ServiceException;

    /**
     * 热门板块
     * - 根据收藏量排序
     * @return
     * @throws ServiceException
     */
    List<Board> queryHotlist() throws ServiceException;
}
